<div class="filter">
<?php echo $filter ?>
</div>
<div  class="box">
<table class="boxlist">
	<thead >
		<tr >
			<th style='width:40px;'>
				Code
			</th>
			<th >
				Name
			</th>
			<th >
				Artist
			</th>
			<th style='width:40px;'>
				Type
			</th>
			<th class='sortable' col='year' style='width:40px;'>
				Year
			</th>
			<th style='width:150px;'>
				Action
			</th>
		</tr>
	</thead>
<?php foreach ($result as $row): ?>
	<tr >
		<td >
			<?php $code = 'WM'.str_pad($row['id'],3,'0',STR_PAD_LEFT) ?>
			<?php
				$label = $code;
				$rurl= array('quickview','id'=>$row['id']);
				$htmlOption = array('class'=>'colorbox');
				echo CHtml::link($label,$rurl,$htmlOption);
			?>
		</td>
		<td >
			<?php echo $row['name'] ?>
		</td>
		<td >
			<?php 
				if (isset($row['artist_id'])) 
					echo Fish::xr(Fish::getRow('artist',$row['artist_id']),'name');
			 ?>
		</td>
		<td >
			<?php echo Yii::app()->params['flag']['referenceType'][$row['reference_type_id']] ?>
		</td>
		<td >
			<?php echo $row['year'] ?>
		</td>
		<td >
			<?php
				$label = '<button class="bt2">Check Availability</button>';
				$rurl= array('quickview','id'=>$row['id']);
				$htmlOption = array('class'=>'colorbox');
				echo CHtml::link($label,$rurl,$htmlOption);
			?>
		</td>
	</tr>
<?php endforeach ?>
</table>
<?php echo $pager ?>
</div>
